# -*- coding: utf-8 -*-
"""
Created on Tue May 26 15:27:02 2020

@author: 张钧铭
"""

class Solution(object):
    def isPalindrome(self, x):
        """
        :type x: int
        :rtype: bool
        """
#        st = str(x)
#        if st == ''.join(reversed(st)):
#            return True
#        else:
#            return False
        r=0
        if x<0 or x!=0 and x%10 ==0:
            return False
        else:
            if x==0:
                return True
            while r<x:
                r=r*10+int(x%10)
                x=int(x/10)
            if r==x:
                return True
            else:
                if int(r/10) == x:
                    return True
        return False
 

s=Solution()
print(s.isPalindrome(1))
